/**
 * File  : EventProcess.h
 * Time  : 2014-12-22 09:31
 * Author: KashingLee
 * Ref   : Null
 */
#ifndef PLCC_EVENT_PROCESS_H_
#define PLCC_EVENT_PROCESS_H_
#include <unistd.h>
#include "./event_queue/EventQueue.h"
#include "WorkThreads.h"
#include "./thread/Mutex.h"


class EventProcess {
 public:
  ~EventProcess();
  static EventProcess* GetInstance();

 public:
  void Start(bool detached = false);
  void Join();
  uint32_t GetAck();
  

 private:
  EventProcess();
  void set_event_queue();
	void set_mutex();

 private:
  static EventProcess     *ptr_;
  static Mutex             mutex_;

  EventQueue<struct play_data>    *play_queue_;
  EventQueue<uint32_t>    				*setting_queue_;
  EventQueue<uint32_t>    				*check_queue_;
  EventQueue<uint32_t>    				*update_queue_;
  EventQueue<uint32_t>    				*ack_queue_;
  EventQueue<struct LogType>  		*net_log_queue_;
  EventQueue<struct LogType>  		*play_log_queue_;
  EventQueue<struct LogType>  		*set_log_queue_;

  PlayThread    *play_thread_;
  SettingThread *setting_thread_;
	NetThread			*net_thread_;
	LogThread			*log_thread_;
  CheckThread   *check_thread_;
  UpdateThread  *update_thread_;

	
};


#endif  //PLCC_EVENT_PROCESS_H_
